function checkEmailAddress(value){
	var regEmail = new RegExp('^[0-9a-z._-]+@{1}[0-9a-z.-]{2,}[.]{1}[a-z]{2,5}$','i');
    return regEmail.test(value);
}

function doPost(request, parameters){
	var httpRequest = new XMLHttpRequest();
	httpRequest.open("POST",request,true);
	httpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	httpRequest.setRequestHeader("Content-length", parameters.length);
	httpRequest.setRequestHeader("Connection", "close");
	
	httpRequest.onreadystatechange = function() {
		//Call a function when the state changes.
		if(httpRequest.readyState == 4 && httpRequest.status == 200) {
			//document.write(httpRequest.responseText);	
			var doc=document.open("text/html","replace");
			var txt=httpRequest.responseText;
			doc.write(txt);
			doc.close();
		}
	}
	
	// create the parameter string
	// iterate the parameters array
	var parameterString = ""; 
	var key;
	for(key in parameters){
		if(parameters.hasOwnProperty(key)){
			parameterString += encodeURIComponent(key)+ '=' + encodeURIComponent(parameters[key])+'&';
		}
	}
	
	httpRequest.send(parameterString);
}

function sendRequest(request){
	var url = location.href;
    var baseURL = url.substring(0, url.indexOf('/', 14));
    location.href = baseURL + request;
}

function Href(request){
	var url = location.href;
    var baseURL = url.substring(0, url.indexOf('/', 14));
    url = baseURL + request;
    return url;
}